<!DOCTYPE html>
<meta charset="utf-8">
<script src="/bower_components/webcomponentsjs/webcomponents-loader.js"></script>
<script src="/bower_components/web-component-tester/browser.js"></script>
<link rel="import" href="/bower_components/iron-test-helpers/iron-test-helpers.html">
<link rel="import" href="/elements/som-test-expectations/som-edit-expectation-form.html">
<test-fixture id="basic">
  <template>
    <som-edit-expectation-form></som-edit-expecation-form>
  </template>
</test-fixture>
<script>
(function() {
  'use strict';

  suite('basic tests', function() {
    var element;

    let val = {
      'FileName': 'third_party/blink/web_tests/TestExpectations',
      'LineNumber': 1779,
      'TestName': 'accessibility/aria-activedescendant.html',
      'Bugs': ['crbug.com/620432'],
      'Modifiers': null,
      'Expectations': ['Failure'],
    };

    setup(function() {
      element = fixture('basic');
    });

    test('renders basic', function(done) {
      element.expectation = val;
      flush(() => {
        let root = Polymer.dom(element.root);
        assert.isDefined(element._editValue);
	      assert.deepEqual(element._editValue, element.expectation);

        assert.equal(element.modifierValues.length, root.querySelectorAll('.modifier-checkbox').length);
        assert.equal(element.expectationValues.length, root.querySelectorAll('.expectation-checkbox').length);
        assert.equal(val.Bugs.length, root.querySelectorAll('.bug-value').length);
        done();
      });
    });
  });
})();
</script>
